/*
 * Server.h
 *
 *  Created on: 2022年10月4日
 *      Author: wocao
 */
#include <sys/socket.h>
#include <unistd.h>
#include <iostream>
#include <sys/types.h>
#include <cstring>
#include <sys/epoll.h>
#include <sys/un.h>
#include "Mque.h"
#include "command/CreateCommand.h"
#include "command/DelCommand.h"
#include "command/InsertCommand.h"
#include "command/GetCommand.h"
#include "command/TakeCommand.h"
using namespace std;
#ifndef SERVER_H_
#define SERVER_H_

class Server {
public:
	Server(Mque* pmq);
	void start();
	rest cont(char* buf,int len);
//	char* sen(string function,string mqname,string type,string data);
	void rev(string flag,rest re,int resoc);
	virtual ~Server();
private:
	const int EPO_MAX = 256;
	Mque* pmq;
	int ser_socket = 0;
	char *socid = "/home/wocao/sj.soc";
	struct  sockaddr_un     serv_addr, cli_addr;
};

#endif /* SERVER_H_ */
